package com.accloud.service;

import com.accloud.cloudservice.AC;
import com.accloud.common.ACConfiguration;
import com.accloud.common.ACHelper;
import com.accloud.common.ACSignature;
import com.accloud.utils.LogUtil;
import com.accloud.utils.PreferencesUtils;

public class ACContext {
    private String accessMode;
    private ACHelper helper;
    private String majorDomain;
    private Long majorDomainId;
    private Long methodVersion;
    private String nonce;
    private String phoneId;
    private String signature;
    private String subDomain;
    private String timeout;
    private String timestamp;
    private String traceId;
    private String traceStartTime;
    private String userId;

    public ACContext(String majorDomain2, String subDomain2, long userId2) {
        this.majorDomain = majorDomain2;
        this.subDomain = subDomain2;
        this.userId = String.valueOf(userId2);
        this.helper = new ACHelper();
        ACSignature zSignature = this.helper.genSignature();
        this.timestamp = String.valueOf(zSignature.getTimestamp());
        this.timeout = String.valueOf(zSignature.getTimeout());
        this.nonce = zSignature.getNonce();
        this.signature = zSignature.getSignature();
        this.phoneId = AC.phoneId;
    }

    public ACContext(String majorDomain2, boolean refreshToken) {
        this.majorDomain = majorDomain2;
        if (refreshToken) {
            this.userId = String.valueOf(PreferencesUtils.getLong(AC.context, ACConfiguration.KEY_USERID, 0));
            this.helper = new ACHelper();
            ACSignature zSignature = this.helper.genRefreshSignature();
            this.timestamp = String.valueOf(zSignature.getTimestamp());
            this.timeout = String.valueOf(zSignature.getTimeout());
            this.signature = zSignature.getSignature();
            this.nonce = zSignature.getNonce();
        }
        this.phoneId = AC.phoneId;
    }

    public Long getMajorDomainId() {
        return this.majorDomainId;
    }

    public void setMajorDomainId(long majorDomainId2) {
        this.majorDomainId = Long.valueOf(majorDomainId2);
    }

    public String getMajorDomain() {
        return this.majorDomain;
    }

    public void setMajorDomain(String majorDomain2) {
        this.majorDomain = majorDomain2;
    }

    public String getSubDomain() {
        return this.subDomain;
    }

    public void setSubDomain(String subDomain2) {
        this.subDomain = subDomain2;
    }

    public String getUserId() {
        return this.userId;
    }

    public void setUserId(String userId2) {
        this.userId = userId2;
    }

    public String getTraceId() {
        return this.traceId;
    }

    public String getTraceStartTime() {
        return this.traceStartTime;
    }

    public void setTimestamp(String timestamp2) {
        this.timestamp = timestamp2;
    }

    public String getTimestamp() {
        return this.timestamp;
    }

    public String getTimeout() {
        return this.timeout;
    }

    public void setSignature(String signature2) {
        this.signature = signature2;
    }

    public String getSignature() {
        return this.signature;
    }

    public void setNonce(String nonce2) {
        this.nonce = nonce2;
    }

    public String getNonce() {
        return this.nonce;
    }

    public String getAccessMode() {
        return this.accessMode;
    }

    public void setAccessMode(String accessMode2) {
        this.accessMode = accessMode2;
    }

    public String getPhoneId() {
        return this.phoneId;
    }

    public void setPhoneId(String phoneId2) {
        this.phoneId = phoneId2;
    }

    public Long getMethodVersion() {
        return this.methodVersion;
    }

    public void setMethodVersion(Long methodVersion2) {
        this.methodVersion = methodVersion2;
    }
}
